package org.zhadoop.stream.cql.semanticanalyzer.parser.context;

import java.util.List;

import org.zhadoop.stream.cql.DriverContext;
import org.zhadoop.stream.cql.exception.CQLException;
import org.zhadoop.stream.cql.exception.SemanticAnalyzerException;
import org.zhadoop.stream.cql.hooks.SemanticAnalyzeHook;
import org.zhadoop.stream.cql.semanticanalyzer.SemanticAnalyzer;
import org.zhadoop.stream.cql.semanticanalyzer.parsecontextwalker.ParseContextWalker;
import org.zhadoop.stream.cql.tasks.Task;

/**
 * from 解析内容
 * @author zwd
 *
 */
public class StreamSourceContext extends ParseContext{
	
	private String streamName;

	private SelectStatementContext subQuery;
	
	public String getStreamName() {
		return streamName;
	}

	public void setStreamName(String streamName) {
		this.streamName = streamName;
	}

	public SelectStatementContext getSubQuery() {
		return subQuery;
	}

	public void setSubQuery(SelectStatementContext subQuery) {
		this.subQuery = subQuery;
	}

	@Override
	public String toString() {
		return streamName != null ? streamName : "( " + subQuery + " )";
	}
	
	@Override
	public Task createTask(DriverContext driverContext, List<SemanticAnalyzeHook> analyzeHooks) throws CQLException {
		return null;
	}

	@Override
	public SemanticAnalyzer createAnalyzer() throws SemanticAnalyzerException {
		return null;
	}

	@Override
	protected void walkChild(ParseContextWalker walker) {
		walkExpression(walker, subQuery);
	}

	
}
